package com.ph.clouds.tracker.strategy;


/**
 * @Author yushuangjiang
 * @Time 2021/8/2 12:03
 * @Description： 上传策略
 */
public enum TrackerUploadStrategy {

    NOW(0),            // 实时传输
    NEXT_LAUNCH(-1),   // 下次启动时上传一次
    TIME_MINUTER(2);   // 按分钟上传

    private int value;

    TrackerUploadStrategy(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static TrackerUploadStrategy getCategory(int value) {
        TrackerUploadStrategy category;
        if (value == NOW.value) {
            category = NOW;
        } else if (value == NEXT_LAUNCH.value) {
            category = NEXT_LAUNCH;
        } else if (value == TIME_MINUTER.value) {
            category = TIME_MINUTER;
        } else {
            category = NOW;
        }
        return category;
    }
}
